﻿<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
  
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>What's New </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="What's New ">
    <meta name="generator" content="docfx 2.59.4.0">
    
    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">
    
    
    
  </head>
  <body data-spy="scroll" data-target="#affix" data-offset="120">
    <div id="wrapper">
      <header>
        
        <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
          <div class="container">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              
              <a class="navbar-brand" href="../index.html">
                <img id="logo" class="svg" src="../logo.svg" alt="">
              </a>
            </div>
            <div class="collapse navbar-collapse" id="navbar">
              <form class="navbar-form navbar-right" role="search" id="search">
                <div class="form-group">
                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
                </div>
              </form>
            </div>
          </div>
        </nav>
        
        <div class="subnav navbar navbar-default">
          <div class="container hide-when-search" id="breadcrumb">
            <ul class="breadcrumb">
              <li></li>
            </ul>
          </div>
        </div>
      </header>
      <div role="main" class="container body-content hide-when-search">
        
        <div class="sidenav hide-when-search">
          <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
          <div class="sidetoggle collapse" id="sidetoggle">
            <div id="sidetoc"></div>
          </div>
        </div>
        <div class="article row grid-right">
          <div class="col-md-10">
            <article class="content wrap" id="_content" data-uid="">
<h1 id="whats-new">What's New</h1>

<p>Harmony 2 has come a long way since the last release 1.2.0.1. Here are all the changes:</p>
<h4 id="new">New</h4>
<p>CI/CD on Azure, Travis and AppVeyor<br>
Switched to <code>MonoMod.Common</code> for shared low level patching with MonoMod project<br>
Works with more .NET versions<br>
Inline prevention for Mono<br>
4th patch type: <code>Finalizer</code> - for handling and manipulating exceptions<br>
Reverse Patching (original onto one of your stub methods)<br>
Convenience extension methods for <code>CodeInstruction</code><br>
Selective debug log with <code>[HarmonyDebug]</code> annotation - works even with future changes of the method<br>
<code>Prepare</code>/<code>Cleanup</code> will be called even with exceptions during patching<br>
Cleanup can now receive and return the current Exception during patching<br>
Better exception reporting with <code>HarmonyException</code><br>
Automatic documentation generated to <code>https://harmony.pardeike.net</code><br>
AccessTools has methods for declared members<br>
<code>FastAccess</code> now deals with generics<br>
<code>Manipulator</code> transpiler helper<br>
Get IL code from a method<br>
Support for IL InlineSignature (patching methods with CALLI)</p>
<h4 id="fixed">Fixed</h4>
<p>Priority field spelling<br>
<code>Traverse</code> can handle static members<br>
Methods returning struct types are now patchable<br>
Main API is now properly divided into static/instance methods<br>
<code>HarmonyMethod</code> and other high level API throws on null input<br>
Patch sorting<br>
DeepCopy works with nullable types<br>
Patch annotations API cleaned up<br>
<code>FieldRef</code> covers more cases and is simplified<br>
<code>__result</code> assignability checks<br>
Handling <code>__state</code> without Prefix<br>
Debug log writes out full type names<br>
Documentation now uses compiled code snippets for correctness<br>
<code>Traverse</code> works with inherited fields, properties and methods</p>
<h4 id="changes">Changes</h4>
<p>Removed Self-patching<br>
Renamed <code>Add()</code> extension on <code>IEnumerable&lt;T&gt;</code> and <code>T[]</code> to <code>AddItem()</code> to avoid conflicts<br>
<code>HarmonyInstance</code> is now called <code>Harmony</code> and <code>Harmony</code> namespace is now called <code>HarmonyLib</code></p>
</article>
          </div>
          
          <div class="hidden-sm col-md-2" role="complementary">
            <div class="sideaffix">
              <div class="contribution">
                <ul class="nav">
                  <li>
                    <a href="https://github.com/pardeike/Harmony/blob/master/Harmony/Documentation/articles/new.md/#L1" class="contribution-link">Improve this Doc</a>
                  </li>
                </ul>
              </div>
              <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
                <h5>In This Article</h5>
                <div></div>
              </nav>
            </div>
          </div>
        </div>
      </div>
      
      <footer>
        <div class="grad-bottom"></div>
        <div class="footer">
          <div class="container">
            <span class="pull-right">
              <a href="#top">Back to top</a>
            </span>
            
            <span>Generated by <strong>DocFX</strong></span>
          </div>
        </div>
      </footer>
    </div>
    
    <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
    <script type="text/javascript" src="../styles/docfx.js"></script>
    <script type="text/javascript" src="../styles/main.js"></script>
  </body>
</html>
